<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>layout 后台大布局 - Layui</title>
    <link rel="stylesheet" href="../static/layui/css/layui.css">
</head>
<body class="layui-layout-body layui-form" id="body">
<div class="layui-layout layui-layout-admin">
    <% include "../login/header.html" %>
    <% include "../login/left.html" %>
    <div class="layui-body layui-this">
        <% include "./list.html" %>
        <div class="layui-row layui-col-space15;">
            <div class="layui-col-md12" style="">
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div class="layui-form-item">
                            <label class="layui-form-label">用户名</label>
                            <div class="layui-input-block">
                                <input type="text" name="username" lay-verify="required" placeholder="请输入用户名"
                                       autocomplete="off"
                                       class="layui-input" readonly="readonly" value="<$ userinfo.username $>"/>
                                <input type="hidden" id="id" name="id" value="<$ userinfo.id $>"/>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">真实姓名</label>
                            <div class="layui-input-block">
                                <input type="text" name="real_name" lay-verify="required" placeholder="请输入姓名"
                                       autocomplete="off"
                                       class="layui-input" value="<$ userinfo.real_name $>"/>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">联系电话</label>
                            <div class="layui-input-block">
                                <input type="text" name="phone" lay-verify="required" placeholder="请输入电话"
                                       autocomplete="off"
                                       class="layui-input" value="<$ userinfo.phone $>"/>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">联系邮箱</label>
                            <div class="layui-input-block">
                                <input type="text" name="email" lay-verify="required" placeholder="请输入邮箱"
                                       autocomplete="off"
                                       class="layui-input" value="<$ userinfo.email $>"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">状态</label>
                            <div class="layui-input-block">
                                <select name="enabled" id="account_type" lay-filter="account_select">
                                    <option value="0" selected="selected">个人</option>
                                    <option value="1">公司</option>
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item" id="company_name_div" style="display: none">
                            <label class="layui-form-label">公司名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="company_name" lay-verify="required" placeholder="请输入公司名称"
                                       autocomplete="off"
                                       class="layui-input" value="<$ userinfo.company_name $>"/>
                            </div>
                        </div>

                        <button class="layui-btn layuiadmin-btn-useradmin" style="float: right" id="addBtn" lay-submit
                                lay-filter="LAY-userCenter-front-add">
                            更新
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>

<div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
</div>
</div>
<script src="../static/layui/layui.js"></script>
<script src="/static/js/jquery.min.js" media="all"></script>

<script>
    layui.use(['element', 'form'], function () {
        var element = layui.element;
        let form = layui.form;
        form.render('select');
        form.on('select(account_select)', function (data) {
            if (data.value == 1) {
                $('#company_name_div').css('display', 'block');
            } else {
                $('#company_name_div').css('display', 'none');
            }
        });
        layui.config({
            base: '/static/layuiadmin/userCenter'
        }).extend({
            userCenter: '/userCenterIndex', //主入口模块
        }).use(['userCenter'], function () {
        });
    });


</script>
</body>
</html>
